//
//  HomeViewController.m
//  WANTS购物
//
//  Created by xuNick on 16/5/27.
//  Copyright © 2016年 NN. All rights reserved.
//

#import "HomeViewController.h"
#import "HomeTableViewCell.h"
#import "NetworkTool.h"

@interface HomeViewController ()

@end

@implementation HomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UINib *nib = [UINib nibWithNibName:@"HomeTableViewCell" bundle:nil];
    [self.tableView registerNib:nib forCellReuseIdentifier:@"cell"];
    /*
     http://api.wantscart.com/aggregator/571/41/entity?
     v=i1.0.5
     Accept=/*
    User-Agent=hao%20wu/1.0.5%20(iPhone;%20iOS%209.3.2;%20Scale/2.00)
    bundleId=com.wantscart.shishang
    Accept-Language=zh-Hans-CN;q=1
    token=w1N3dahtnIny9Vaty4WZskJiOc0cDdazlDNriw2bdfNGLwnlmbatVWYnyRXat6EDNsxQmIc2QDMa4UzdrhRDNd2cDLwv5GNaiYmcn6ADdtz1mIsAAAAc==Qf
     */
    NSDictionary *para = @{
                           @"v":@"i1.0.5",
                           @"Accept":@"*/*",
                           @"User-Agent":@"hao%20wu/1.0.5%20(iPhone;%20iOS%209.3.2;%20Scale/2.00)",
                           @"bundleId":@"com.wantscart.shishang",
                           @"Accept-Language":@"zh-Hans-CN;q=1",
                           @"token":@"w1N3dahtnIny9Vaty4WZskJiOc0cDdazlDNriw2bdfNGLwnlmbatVWYnyRXat6EDNsxQmIc2QDMa4UzdrhRDNd2cDLwv5GNaiYmcn6ADdtz1mIsAAAAc==Qf"
                           };
    
    [[NetworkTool shareNetworkTool] request:RequestMethodGet urlString:@"http://api.wantscart.com/aggregator/571/41/entity" parameters:para finished:^(id responseObject, NSError *error) {
        NSLog(@"%@",responseObject);
        NSLog(@"%@",error);
    }];
}


#pragma mark - dataSource\

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 20;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    HomeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    cell.backgroundColor = [UIColor cyanColor];
    return cell;
}


@end
